﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Protocolo;



public partial class Mi_perfil : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Persona p = Fabrica_persona.crear(Session["usuario"]);
            Label1.Text = p.Nombre;
            Label2.Text = p.Nombre2;
            Label3.Text = p.Apellido;
            Label4.Text = p.Apellido2;
            Label5.Text = p.CI.ToString();
            Label6.Text = p.Correo;
            Label7.Text = p.Login;

            if (Session["usuario"].GetType().IsInstanceOfType(new Guia())) // Guia
            {
                Guia p2 = (Guia) Session["usuario"];
                Panel2.Visible = true;
                Label8.Text = p2.Exp.ToString(); //expediente, carrera, año alñergia vehiculo
                Label9.Text = p2.Carrera;
                Label10.Text = p2.Año_semestre;
                Label11.Text = p2.Alergias;
                Label12.Text = p2.Vehiculo;

            }
            if (Session["usuario"].GetType().IsInstanceOfType(new Organizador()))// Organizador
            {
                Organizador p2 = (Organizador) Session["usuario"];
                Panel1.Visible = true;
                Label13.Text = p2.Int_Ext;
                if (Label13.Text == "Int")
                {
                    Panel3.Visible = true;
                    Label14.Text = p2.Dependencia;
                    Label16.Text = p2.Extucab.ToString();
                }
                else Panel3.Visible = false;
                
            }
        }
        String bandera = ClientQueryString;
        String banderita="false";
        if (bandera.Length>0)
         banderita = bandera.Substring(8);

        if (banderita.Equals("true"))
            Label15.Visible = true;
        
    }
   
    protected void Button1_Click1(object sender, EventArgs e)
    {
        Response.Redirect("modificar_perfil.aspx");
        
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx");
    }
    protected void Button2_Click1(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx");
    }
}
